<template>
  <div>
    <van-nav-bar
        title="谢谢惠顾"
        right-text="首页"
        @click-right="onClickRight"
    />

  <div class="header">
    <h3>订单完成&gt;</h3>
  </div>
  <div class="buy">
    <p>感谢您对生鲜买菜的信任，祝您生活愉快</p>
    <a @click="deleteOrders">
      <span>删除订单</span>
    </a>
    <a @click="firstPage">
      <span>再次购买</span>
    </a>
  </div>
  <div class="mes">
    <div class="time">
      <p>预约时间</p>
      <p>尽快送达,(预计14:15前)</p>
    </div>
    <div class="adress">
      <p>收货地址</p>
      <p>{{this.$route.params.address}}</p>
    </div>
  </div>
  <div class="price">
    <div class="one">
      <p>商品金额</p>
      <p>￥{{  this.$route.params.actualPrice }}</p>
    </div>
    <div class="two">
      <p>配送费</p>
      <p>￥00.00</p>
    </div>
    <div class="three">
      <p>实付金额</p>
      <p>￥{{  this.$route.params.actualPrice }}</p>
    </div>
  </div>
  </div>
</template>

<script>
import {NavBar, Toast} from 'vant';

export default {
  components: {
    [NavBar.name]: NavBar,
  },
  data() {
    return {

    }
  },
  methods: {
    onClickRight(){
      this.$router.push('firstPage')
    },
    firstPage(){
      this.$router.push('type')
    },
    deleteOrders(){
      let id=this.$route.params.ordersId;
      this.$axios.get('/api/app/deleteOrdersById?id='+id)
          .then(res=>{
            console.log(res.data)
            if(res.data.code==200){
              Toast.success('删除成功');
              this.$router.push('my')
            }
          })
    }

  },
  created() {
    this.$route.params.address;
    this.$route.params.actualPrice;
    this.$route.params.ordersId;
  }
}
</script>

<style scoped>

  @import "css/order details.css";

</style>